package com.iaiai.cobra.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iaiai.cobra.repository.bean.Post;
import com.iaiai.cobra.repository.bean.Role;
import com.iaiai.cobra.repository.mapper.RoleMapper;
import com.iaiai.cobra.system.service.RoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with RoleServiceImpl.
 * Package: com.iaiai.cobra.system.service.impl
 * Author: iaiai
 * Create Time: 2024/6/28 20:59
 * QQ: 176291935
 * Email: 176291935@qq.com
 * Description:
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    //查询排序最大的
    public Role queryMax(){
        return getBaseMapper().queryMax();
    }

    //分页查询
    public Page<Role> queryPage(Page page, String search){
        return getBaseMapper().queryPage(page,search);
    }

    //查询用户的角色
    public List<Role> queryByUser(Long userId){
        return getBaseMapper().queryByUser(userId);
    }

}
